# Author : Lzhiyu
# 时间 : 2021/12/23 11:07
# 项目名称 : reserch4
# Software: PyCharm
from flask import request

def reserch4letters(py_vowels,py_word):
    """
    :param py_vowels: 用户在 index.html 输入的 vowels参数
    :param py_word: 用户在 index.html 输入的 word参数
    :return:返回词频字典结果
    """
    py_vowels = request.form['vowels']
    py_word = request.form['word']
    py_found = {}
    for i in py_word:
        if i in py_vowels:
            # 初始化 setdefault
            py_found.setdefault(i, 0)
            py_found[i] += 1
    return py_found